#ifndef VIEWER_H
#define VIEWER_H

#include <mutex>
#include <stdio.h>
#include "MapDrawer.h"



class MapDrawer;


class Viewer
{
public:
	Viewer(MapDrawer *pMapDrawer, float mViewpointX, float mViewpointY, float mViewpointZ, float mViewpointF, float fps);
	~Viewer();

	void RequestFinish();

	void RequestStop();

	bool isFinished();

	bool isStopped();

	void Release();

	bool Stop();

	bool CheckFinish();

	void SetFinish();

	void Run();

private:
	MapDrawer* m_MapDrawer;

	float m_ViewpointX;
	float m_ViewpointY;
	float m_ViewpointZ;
	float m_ViewpointF;

	double m_T;


	std::mutex m_MutexFinish;
	bool m_FinishRequested;
	bool m_Finished;


	bool m_Stopped;
    bool m_StopRequested;
    std::mutex m_MutexStop;
};

#endif //VIEWER_H
